package com.example.exam.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 考试实体类
 */
public class Exam implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private int examId;           // 考试ID
    private String examName;      // 考试名称
    private LocalDateTime startTime;   // 考试开始时间
    private LocalDateTime endTime;     // 考试结束时间
    private int duration;         // 考试时长(分钟)
    private int totalScore;       // 总分
    private String status;        // 考试状态(active-进行中，inactive-未激活，finished-已结束)
    private LocalDateTime createdTime;  // 创建时间
    
    // 构造方法
    public Exam() {}
    
    public Exam(int examId, String examName, LocalDateTime startTime, LocalDateTime endTime, int duration, int totalScore, String status, LocalDateTime createdTime) {
        this.examId = examId;
        this.examName = examName;
        this.startTime = startTime;
        this.endTime = endTime;
        this.duration = duration;
        this.totalScore = totalScore;
        this.status = status;
        this.createdTime = createdTime;
    }
    
    // Getters and Setters
    public int getExamId() {
        return examId;
    }
    
    public void setExamId(int examId) {
        this.examId = examId;
    }
    
    public String getExamName() {
        return examName;
    }
    
    public void setExamName(String examName) {
        this.examName = examName;
    }
    
    public LocalDateTime getStartTime() {
        return startTime;
    }
    
    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }
    
    public LocalDateTime getEndTime() {
        return endTime;
    }
    
    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }
    
    public int getDuration() {
        return duration;
    }
    
    public void setDuration(int duration) {
        this.duration = duration;
    }
    
    public int getTotalScore() {
        return totalScore;
    }
    
    public void setTotalScore(int totalScore) {
        this.totalScore = totalScore;
    }
    
    public String getStatus() {
        return status;
    }
    
    public void setStatus(String status) {
        this.status = status;
    }
    
    public LocalDateTime getCreatedTime() {
        return createdTime;
    }
    
    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }
    
    @Override
    public String toString() {
        return "Exam{" +
                "examId=" + examId +
                ", examName='" + examName + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", duration=" + duration +
                ", totalScore=" + totalScore +
                ", status='" + status + '\'' +
                ", createdTime=" + createdTime +
                '}';
    }
}    